package com.spring.boot.configer;

//import com.spring.boot.interceptor.RedisCountInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class AdminWebConfig implements WebMvcConfigurer {

    /**
     * Filter，Interceptor哪个好
     * Filter是servlet原生组件，可以脱离spring使用
     * Interceptor是spring组件，可以用spring的功能
     */
//    @Autowired
//    RedisCountInterceptor redisCountInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

//        registry.addInterceptor(redisCountInterceptor)
//                .addPathPatterns("/**")// 拦截所有请求路径
//                .excludePathPatterns("/","/img/**");// 除了静态资源不拦截


    }
}
